package chixing.day06.homework;

/**
 * 属性：userName（用户名）、points（积分）
 * 构造函数：初始化用户名与积分
 * 方法：printUser()：输出用户名和积分
 */
public class User {
    private String userName;
    private double points;

    public User(){}
    public User(String userName, double points) {
        this.userName = userName;
        this.points = points;
    }

    /**
     * 输出用户名和积分
     */
    public void printUser(){
        System.out.println(
                "用户名：" + userName + "积分：" + points
        );
    }

    public String getUserName() {
        return userName;
    }

    public void setUserName(String userName) {
        this.userName = userName;
    }

    public double getPoints() {
        return points;
    }

    public void setPoints(double points) {
        this.points = points;
    }

    @Override
    public String toString() {
        return "User{" +
                "userName='" + userName + '\'' +
                ", points=" + points +
                '}';
    }
}
